package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.approval.vo.UserApproVO;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.TransferAccountsBatchAddDTO;
import org.jsola.hr.dto.TransferAccountsBatchAgainAddDTO;
import org.jsola.hr.dto.TransferAccountsBatchUpdateDTO;
import org.jsola.hr.query.*;
import org.jsola.hr.vo.*;
import org.jsola.hr.vo.payAli.AliPayUrlVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 转账批次
 *
 * @author zhr
 */
@Api(tags = "hr-转账批次")
public interface ITransferAccountsBatchControllerAPI {

    /**
     * 新增转账批次
     * @param transferAccountsBatchAddDTO 转账批次新增实体
     * @return 转账批次展示对象
     */
    @ApiOperation(value = "新增转账批次")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchAddDTO", dataType = "TransferAccountsBatchAddDTO", value = "新增转账批次", paramType = "body")
    })
    Result<TransferAccountsBatchVO> save(TransferAccountsBatchAddDTO transferAccountsBatchAddDTO);

    /**
     * 根据参数直接创建批次
     * @param transferBuildDetailQuery 参数信息
     * @return 成功和失败的明细列表
     */
    @ApiOperation(value = "根据参数直接创建批次")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferBuildDetailQuerye", dataType = "TransferBuildDetailQuery", value = "参数信息", paramType = "body")
    })
    Result<TransferAccountsDetailImportAllVO> saveBatchAndDetail(TransferBuildDetailQuery transferBuildDetailQuery);

    /**
     * 驳回批次重新发起
     * @param transferAccountsBatchAgainAddDTO 重新发起【转账批次】的DTO
     * @return 转账批次详情信息
     */
    @ApiOperation(value = "驳回批次重新发起")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchAgainAddDTO", dataType = "TransferAccountsBatchAgainAddDTO", value = "重新发起【转账批次】的DTO", paramType = "body")
    })
    Result<TransferAccountsBatchVO> saveAgainByBatchId(TransferAccountsBatchAgainAddDTO transferAccountsBatchAgainAddDTO);


    /**
     * 修改转账批次
     * @param transferAccountsBatchUpdateDTO 转账批次
     * @return 更新数量
     */
    @ApiOperation(value = "修改转账批次")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchUpdateDTO", dataType = "TransferAccountsBatchUpdateDTO", value = "修改转账批次", paramType = "body")
    })
    Result<Integer> update(TransferAccountsBatchUpdateDTO transferAccountsBatchUpdateDTO);




    /**
     * 删除单个转账批次，彻底删除
     * @param transferAccountsBatchId 转账批次id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个转账批次，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchId", dataType = "String", value = "转账批次id", paramType = "path")
    })
    Result<Integer> delete(String transferAccountsBatchId);


    /**
     * 批量删除转账批次，彻底删除
     * @param transferAccountsBatchIds 转账批次id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除转账批次，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchIds", dataType = "String[]", value = "转账批次id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] transferAccountsBatchIds);


    /**
     * 根据转账批次id查询转账批次详情
     * @param transferAccountsBatchId 转账批次id
     * @return 转账批次详情
     */
    @ApiOperation(value="根据转账批次id查询转账批次详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchId", dataType = "String", value = "转账批次id", paramType = "path")
    })
    Result<TransferAccountsBatchVO> findById(String transferAccountsBatchId);


    /**
     * 查询转账批次
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value="查询转账批次")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<List<TransferAccountsBatchListVO>> listAll(TransferAccountsBatchQuery transferAccountsBatchQuery);


     /**
     * 分页查询转账批次
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value="分页查询转账批次")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsBatchListVO>> page(TransferAccountsBatchQuery transferAccountsBatchQuery);

    /**
     * 分页查询转账批次(post请求)
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value="分页查询转账批次（post请求）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsBatchListVO>> pagePost(TransferAccountsBatchQuery transferAccountsBatchQuery);


    /**
     * 发起申请
     *
     * @param transferAccountsBatchId 转账批次id
     * @param flowId                  审批id
     * @return 审批详情
     */
    @ApiOperation(value="发起申请")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchId", dataType = "String", value = "转账批次id", paramType = "path"),
            @ApiImplicitParam(name = "flowId", dataType = "String", value = "审批id", paramType = "path")
    })
    Result<UserApproVO> startApprover(String transferAccountsBatchId, String flowId);

    /**
     * 分页查询转账批次-审批中
     *
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询转账批次-审批中")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsBatchListVO>> pageApproving(TransferAccountsBatchQuery transferAccountsBatchQuery);

    /**
     * 分页查询转账批次-已通过
     *
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询转账批次-已通过")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsBatchListVO>> pageApprovedPass(TransferAccountsBatchQuery transferAccountsBatchQuery);

    /**
     * 分页查询转账批次-已驳回
     *
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询转账批次-已驳回")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsBatchListVO>> pageApprovedReject(TransferAccountsBatchQuery transferAccountsBatchQuery);

    /**
     * 分页查询转账批次-抄送我
     *
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询转账批次-抄送我")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsBatchListVO>> pageApproveNotifierMe(TransferAccountsBatchQuery transferAccountsBatchQuery);

    /**
     * 分页查询包含审批状态的转账批次(审批中+已通过+已驳回+抄送我)
     *
     * @param transferAccountsBatchQuery 转账批次查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询包含审批状态的转账批次(审批中+已通过+已驳回+抄送我)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsBatchQuery", dataType = "TransferAccountsBatchQuery", value = "转账批次查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsBatchListVO>> pageApprove(TransferAccountsBatchQuery transferAccountsBatchQuery);

    /**
     * 导入的方式创建批次
     * @param file 待识别的文件
     * @param companyId 公司id
     * @param companyName 公司名称
     * @param type 到账方式
     * @param orderTitle 批次名称
     * @param remark 备注
     * @return 批次明细Lst
     */
    @ApiOperation(value = "导入的方式创建批次")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", dataType = "MultipartFile", value = "新增计薪人员：支付宝模板", paramType = "body"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "query"),
            @ApiImplicitParam(name = "companyName", dataType = "String", value = "公司名称", paramType = "query"),
            @ApiImplicitParam(name = "type", dataType = "Integer", value = "到账方式,1支付宝,2微信,3银行", paramType = "query"),
            @ApiImplicitParam(name = "orderTitle", dataType = "String", value = "批次名称", paramType = "query"),
            @ApiImplicitParam(name = "remark", dataType = "String", value = "备注", paramType = "query")
    })
    Result<TransferAccountsDetailImportAllVO> saveBatchAndDetailByFile(MultipartFile file, String companyId, String companyName,
                                                                       Integer type, String orderTitle, String remark);

    /**
     * 根据批次id 及 支付宝的code 发起支付宝批次转账到户
     * @param transferStartZfbBatchQuery 发起支付宝批次订单参数
     * @return 支付URL
     */
    @ApiOperation(value = "根据批次id 及 支付宝的code 发起支付宝批次转账到户")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferStartZfbBatchQuery", dataType = "TransferStartZfbBatchQuery", value = "发起支付宝批次订单参数", paramType = "body")
    })
    Result<AliPayUrlVO> zfbStartTransferAccounts(TransferStartZfbBatchQuery transferStartZfbBatchQuery);

    /**
     * 支付宝安全发  发送验证码
     * @param phone 手机号
     * @return 是否发送成功
     */
    @ApiOperation(value = "支付宝安全发  发送验证码")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phone", dataType = "String", value = "手机号", paramType = "path")
    })
    Result<Boolean> sendSafetyPayPhoneMessage(String phone);

    /**
     * 根据支付宝发起批次的参数 发起支付宝批次转账到户(安全发无密)
     * @param transferStartZfbSafetyBatchQuery 发起支付宝批次订单参数(安全发无密)
     * @return success
     */
    @ApiOperation(value = "根据支付宝发起批次的参数 发起支付宝批次转账到户(安全发无密)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferStartZfbSafetyBatchQuery", dataType = "TransferStartZfbSafetyBatchQuery", value = "发起支付宝批次订单参数(安全发无密)", paramType = "body")
    })
    Result<String> zfbSafetyStartTransferAccounts(TransferStartZfbSafetyBatchQuery transferStartZfbSafetyBatchQuery);

    /**
     * 根据支付宝发起批次的参数 发起支付宝批次转账到卡(安全发无密)
     * @param transferStartZfbSafetyBatchQuery 发起支付宝批次订单参数(安全发无密)
     * @return success
     */
    @ApiOperation(value = "根据支付宝发起批次的参数 发起支付宝批次转账到卡(安全发无密)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferStartZfbSafetyBatchQuery", dataType = "TransferStartZfbSafetyBatchQuery", value = "发起支付宝批次订单参数(安全发无密)", paramType = "body")
    })
    Result<String> zfbSafetyStartTransferAccountsToBankCard(TransferStartZfbSafetyBatchQuery transferStartZfbSafetyBatchQuery);

    /**
     * 发起微信批次转账到户
     * @param transferStartVxBatchQuery 发起微信批次订单参数
     * @return 支付URL
     */
    @ApiOperation(value = "发起微信批次转账到户")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferStartVxBatchQuery", dataType = "TransferStartVxBatchQuery", value = "发起微信批次订单参数", paramType = "body")
    })
    Result<Integer> vxStartTransferAccounts(TransferStartVxBatchQuery transferStartVxBatchQuery);

    /**
     * 根据平安银行发起批次的参数 发起平安银行批次转账到卡
     * @param transferStartPingAnBankBatchQuery 发起平安银行批次订单参数
     */
    @ApiOperation(value = "根据平安银行发起批次的参数 发起平安银行批次转账到卡")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferStartPingAnBankBatchQuery", dataType = "TransferStartPingAnBankBatchQuery", value = "发起平安银行批次订单参数", paramType = "body")
    })
    Result<Integer> pingAnStartTransferAccounts(TransferStartPingAnBankBatchQuery transferStartPingAnBankBatchQuery);

    /**
     * 查询批次支付状态
     * @param salaryTransferAccountsBatchId 批次id
     * @return 1
     */
    @ApiOperation(value = "查询批次支付状态")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "salaryTransferAccountsBatchId", dataType = "String", value = "批次id", paramType = "path")
    })
    Result<Integer> selectTransferAccountsBatch(String salaryTransferAccountsBatchId);

    /**
     * 缓存商户appAuthToken
     * @param appAuthCode code
     */
    @ApiOperation(value = "缓存商户appAuthToken")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "appAuthCode", dataType = "String", value = "code", paramType = "path")
    })
    Result<Integer> setAppAuthTokenToRedis(String appAuthCode);

    /**
     * 统计各个状态的批次数量
     * @return 统计信息
     */
    @ApiOperation(value = "统计各个状态的批次数量")
    Result<TransferAccountsBatchStatisticsVO> statisticsBatchStatusBySite();

    /**
     * 统计各个状态的批次数量(根据公司List)
     * @param companyIds 公司ids
     * @return 统计信息
     */
    @ApiOperation(value = "统计各个状态的批次数量(根据公司List)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyIds", dataType = "List<String>", value = "公司ids", paramType = "body")
    })
    Result<TransferAccountsBatchStatisticsVO> statisticsBatchStatusByCompanyIds(List<String> companyIds);

    /**
     * 根据配置文件返回对应的支付宝授权链接
     * @return 统计信息
     */
    @ApiOperation(value = "根据配置文件返回对应的支付宝授权链接")
    Result<String> returnAuthorizationUrl();

    /**
     * 根据参数全选发薪人员
     * @param type 类型： 1：人员库，2：花名册
     * @param companyId 公司id
     * @return 批次转账人员信息
     */
    @ApiOperation(value = "根据参数全选发薪人员")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", dataType = "Integer", value = "类型： 1：人员库，2：花名册", paramType = "query"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "query")
    })
    Result<List<TransferBuildDetailAddVO>> buildAllInfo(Integer type, String companyId);

    /**
     * 根据支付宝授权code 修改账号里面的token信息
     * @param code 授权code
     * @param pid 支付宝pid
     * @return 1
     */
    @ApiOperation(value = "根据支付宝授权code 修改账号里面的token信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "code", dataType = "String", value = "授权code", paramType = "path"),
            @ApiImplicitParam(name = "pid", dataType = "String", value = "支付宝pid", paramType = "path")
    })
    Result<Integer> updateZfbAppAuthToken(String code, String pid);



}

